package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.SymUsrco;
import com.ssish.saas.eccs.model.SymUsrcoExample;
import com.ssish.saas.eccs.model.SymUsrcoKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface SymUsrcoMapper {
    long countByExample(SymUsrcoExample example);

    int deleteByExample(SymUsrcoExample example);

    @Delete({
        "delete from SYM_USRCO",
        "where COCD = #{cocd,jdbcType=VARCHAR}",
          "and USRID = #{usrid,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(SymUsrcoKey key);

    @Insert({
        "insert into SYM_USRCO (COCD, USRID, ",
        "INSBY, INSDT, ",
        "UPDBY, UPDDT, ",
        "STNCD, DEPTCD, AUTHLVL, ",
        "COMPINVT, TMPAUTHLVL, ",
        "TMPAUTHEXPDT, NORETRY)",
        "values (#{cocd,jdbcType=VARCHAR}, #{usrid,jdbcType=VARCHAR}, ",
        "#{insby,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, ",
        "#{updby,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP}, ",
        "#{stncd,jdbcType=VARCHAR}, #{deptcd,jdbcType=VARCHAR}, #{authlvl,jdbcType=DECIMAL}, ",
        "#{compinvt,jdbcType=VARCHAR}, #{tmpauthlvl,jdbcType=DECIMAL}, ",
        "#{tmpauthexpdt,jdbcType=TIMESTAMP}, #{noretry,jdbcType=DECIMAL})"
    })
    int insert(SymUsrco record);

    int insertSelective(SymUsrco record);

    List<SymUsrco> selectByExample(SymUsrcoExample example);

    @Select({
        "select",
        "COCD, USRID, INSBY, INSDT, UPDBY, UPDDT, STNCD, DEPTCD, AUTHLVL, COMPINVT, TMPAUTHLVL, ",
        "TMPAUTHEXPDT, NORETRY",
        "from SYM_USRCO",
        "where COCD = #{cocd,jdbcType=VARCHAR}",
          "and USRID = #{usrid,jdbcType=VARCHAR}"
    })
    @ResultMap("com.ssish.saas.eccs.mapper.SymUsrcoMapper.BaseResultMap")
    SymUsrco selectByPrimaryKey(SymUsrcoKey key);

    int updateByExampleSelective(@Param("record") SymUsrco record, @Param("example") SymUsrcoExample example);

    int updateByExample(@Param("record") SymUsrco record, @Param("example") SymUsrcoExample example);

    int updateByPrimaryKeySelective(SymUsrco record);

    @Update({
        "update SYM_USRCO",
        "set INSBY = #{insby,jdbcType=VARCHAR},",
          "INSDT = #{insdt,jdbcType=TIMESTAMP},",
          "UPDBY = #{updby,jdbcType=VARCHAR},",
          "UPDDT = #{upddt,jdbcType=TIMESTAMP},",
          "STNCD = #{stncd,jdbcType=VARCHAR},",
          "DEPTCD = #{deptcd,jdbcType=VARCHAR},",
          "AUTHLVL = #{authlvl,jdbcType=DECIMAL},",
          "COMPINVT = #{compinvt,jdbcType=VARCHAR},",
          "TMPAUTHLVL = #{tmpauthlvl,jdbcType=DECIMAL},",
          "TMPAUTHEXPDT = #{tmpauthexpdt,jdbcType=TIMESTAMP},",
          "NORETRY = #{noretry,jdbcType=DECIMAL}",
        "where COCD = #{cocd,jdbcType=VARCHAR}",
          "and USRID = #{usrid,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(SymUsrco record);
}